<?php
// 商家后台

use App\Kuafu\Activity\Controller\B\ActivityController;
use App\Kuafu\Banner\Controller\B\BannerCommonController;
use App\Kuafu\Banner\Controller\B\BannerConfigController;
use App\Kuafu\Banner\Controller\B\BannerController;
use App\Kuafu\Brand\Controller\B\BrandController;
use App\Kuafu\Category\Controller\B\CategoryController;
use App\Kuafu\Common\Controller\B\UploadController;
use App\Kuafu\Complain\Controller\B\ComplainController;
use App\Kuafu\Config\Controller\B\ConfigController;
use App\Kuafu\Coupon\Controller\B\CouponController;
use App\Kuafu\CouponPackage\Controller\B\CouponPackageController;
use App\Kuafu\CustomerCoupon\Controller\B\CustomerCouponController;
use App\Kuafu\CustomPayment\Controller\B\CustomPaymentController;
use App\Kuafu\Dashboard\Controller\B\DashboardController;
use App\Kuafu\Export\Controller\B\ExportDownloadsController;
use App\Kuafu\Mybank\Controller\MybankEntryController;
use App\Kuafu\Mybank\Controller\B\MybankController;
use App\Kuafu\Order\Controller\B\OrderController;
use App\Kuafu\Shop\Controller\B\CameraController;
use App\Kuafu\Shop\Controller\B\ShopAttributeController;
use App\Kuafu\Shop\Controller\B\ShopStaffRecordController;
use App\Kuafu\Shop\Controller\B\ToolsController;
use App\Kuafu\Shop\Controller\B\UnifiedManagementController;
use App\Kuafu\WaiMai\Controller\B\OrderController as WaiMaiOrderController;
use App\Kuafu\Product\Controller\B\ProductController;
use App\Kuafu\ProductMenu\Controller\B\ProductMenuController;
use App\Kuafu\Shop\Controller\B\AreaController;
use App\Kuafu\Shop\Controller\B\ShopController;
use App\Kuafu\Statistics\Controller\B\StatisticsController;
use App\Kuafu\Sys\Controller\B\MenusController;
use App\Kuafu\User\Controller\B\LoginController;
use App\Kuafu\User\Controller\B\PermissionsController;
use App\Kuafu\User\Controller\B\RoleController;
use App\Kuafu\User\Controller\B\UserController;
use App\Kuafu\User\Controller\B\UserRoleController;
use App\Kuafu\User\Enum\UserCodeEnum;
use App\Kuafu\Wechat\Controller\Applet\WechatCallbackController;
use Illuminate\Support\Facades\Route;
use Kuafu\IpWhite\Controller\IpWhiteController;
use Kuafu\IpWhite\Middleware\KfNetMiddleware;

// 心跳
Route::get('/hello', function () {
    return response()->json(['code' => 200, 'msg' => '', 'data' => []]);
});

// 注册
Route::post('login/register', [LoginController::class, 'register']);

// 登录
Route::prefix('login')->group(function () {
    Route::post('', [LoginController::class, 'login']);
    Route::post('refresh', [LoginController::class, 'refresh']);
});

Route::prefix('common')->group(function () {
    Route::get('getSeparateTime', [\App\Kuafu\Common\Controller\Applet\CommonController::class, 'getSeparateTime']);
});

Route::middleware(['jwtAuth:' . UserCodeEnum::WEB_TYPE, 'common.headerAuth', 'common.userPermissionAuth'])
    ->group(function () {

        // mqtt
        Route::prefix('mqtt')->group(function () {
            Route::get('/getAccount', [\App\Kuafu\Mqtt\Controller\B\MqttController::class, 'getAccount']);
        });

        // 用户中心
        Route::prefix('user')->group(function () {
            Route::get('/list', [UserController::class, 'getUserList']);
            Route::get('/openList', [UserController::class, 'getUserList'])->withoutMiddleware("common.userPermissionAuth");
            Route::get('/info/{userId}', [UserController::class, 'getUserInfo']);
            Route::get('/info', [UserController::class, 'getCurrentUserInfo']);
            Route::put('/', [UserController::class, 'setUserInfo']);
            Route::post('/setUserPassword', [UserController::class, 'setUserPassword']);
            Route::post('/setUserMobile', [UserController::class, 'setUserMobile']);
            Route::post('/', [UserController::class, 'addUser']);
            Route::delete("/{userId}", [UserController::class, 'deletedUser']);
            Route::post("/setUserStatus", [UserController::class, 'setUserStatus']);

            // 职位管理
            Route::prefix('role')->group(function () {
                // 获取职位列表
                Route::get('/', [RoleController::class, 'getRoleList']);
                // 获取职位详情
                Route::get('/{id}', [RoleController::class, 'getRoleInfo']);
                // 删除职位
                Route::delete('/{id}', [RoleController::class, 'deleteRole']);
                // 新建品牌职位
                Route::post('/brand', [RoleController::class, 'addBrandRole']);
                // 修改品牌职位
                Route::put('/brand/{id}', [RoleController::class, 'editRole']);
                // 获取用户所有职位对应的门店
                Route::get('/shop/getAllRole', [RoleController::class, 'getUserAllRole']);
                // 新建门店职位
                Route::post('/shop', [RoleController::class, 'addShopRole']);
                // 修改门店职位
                Route::put('/shop/{id}', [RoleController::class, 'editRole']);
                // 查询 品牌/门店 角色(职位)列表
                Route::get('/type/{type}', [RoleController::class, 'getRoleListById']);
                // 新增商家app职位
                Route::post('/merchant', [RoleController::class, 'addMerchantRole']);
                // 修改商家app职位
                Route::put('/merchant/{id}', [RoleController::class, 'editRole']);
            });

            // 权限管理
            Route::prefix('permission')->group(function () {
                // 获取WEB 品牌 所有权限列表
                Route::get('/brand/{id?}', [PermissionsController::class, 'getBrandPermissions']);
                // 获取POS 门店 所有权限列
                Route::get('/shop/{id?}', [PermissionsController::class, 'getShopPermissions']);
                //获取商家app权限列表
                Route::get('/merchant/{id?}', [PermissionsController::class, 'getMerchantPermissions']);
            });

            // 用户职位管理
            Route::prefix('userRole')->group(function () {
                Route::get('/', [UserRoleController::class, 'getUserRole']);
                Route::post('/', [UserRoleController::class, 'doUserRole']);
                Route::delete('/{userRoleId}', [UserRoleController::class, 'delUserRole']);
            });
        });

        // 品牌
        Route::prefix("brand")->group(function () {
            Route::post("/", [BrandController::class, "addBrand"]);
            Route::get("/", [BrandController::class, "getBrandList"]);
            Route::get("/{brandId}", [BrandController::class, "getBrandInfo"]);
            Route::put("/{brandId}", [BrandController::class, "setBrandInfo"]);
            Route::patch("/{brandId}", [BrandController::class, "setBrandStatus"]);
            Route::delete("/{brandId}", [BrandController::class, "isDeletedBrand"]);
        });

        // 店铺
        Route::prefix("shop")->group(function () {
            Route::post("/", [ShopController::class, "addShop"]);
            Route::get("/list", [ShopController::class, "getShopList"]);
            Route::put("/{shopId}", [ShopController::class, "setShopInfo"]);
            Route::get("/getInfo/{shopId}", [ShopController::class, "getShopInfo"]);
            Route::delete('/{shopId}', [ShopController::class, 'deletedShop']);
            Route::post('/bindProductMenu', [ShopController::class, 'bindProductMenu']);
            Route::get('/bindProductMenu', [ShopController::class, 'getBindProductMenu']);
            Route::get('/bindMenuShops', [ShopController::class, 'getBindMenuShops']);
            Route::get('/getBrandShopList', [ShopController::class, 'getShopListByBrandId']);
            Route::get('/getAllShopList', [ShopController::class, 'getAllShopList']);
            Route::post('/setShopStatus', [ShopController::class, 'setShopStatus']);
            Route::get('/toBindMtShop/{shopId}', [ShopController::class, 'toBindMtShop']); // 美团团购
            Route::post('/toBindWaiMaiShop/{shopId}', [ShopController::class, 'toBindWaiMaiShop']);
            Route::post('/toUnbindWaiMaiShop/{shopId}', [ShopController::class, 'toUnbindWaiMaiShop']);
            Route::get('/getQrCode/{shopId}', [WechatCallbackController::class, 'getQrCode']);
            Route::post('/shopFuYouPaymentsInsert/{shopId}', [ShopController::class, 'shopFuYouPaymentsInsert']);
            Route::put('/shopFuYouPaymentsEdit/{shopId}/{paymentId}',
                [ShopController::class, 'shopFuYouPaymentsEdit']);
            Route::get('/shopSelect', [ShopController::class, 'shopSelect']);
            Route::post('/dyCouponVerifySwitch', [ShopController::class, 'dyCouponVerifySwitch']);
            Route::put('/updateField/{shopId}', [ShopController::class, 'updateField']);
            Route::get('/getShopAttribute/{shopId}', [ShopController::class, 'getShopAttribute']);// 获取门店属性
            Route::put('/updateShopAttribute/{shopId}', [ShopController::class, 'updateShopAttribute']);// 编辑门店属性
            Route::get('/getShopAttributeSearch', [ShopController::class, 'getShopAttributeSearch']);// 获取门店属性筛选项
            Route::get('/getShopByAttributeSearch', [ShopController::class, 'getShopByAttributeSearch']);// 门店筛选通过门店属性

            // 开票信息修改
            Route::put('/invoice/{shopId}', [ShopController::class, 'shopInvoice']);
            Route::post('/bandDouYinShop/{shopId}', [ShopController::class, 'bandDouYinShop']);
            Route::post('/unBandDouYinShop/{shopId}', [ShopController::class, 'unBandDouYinShop']);
            Route::get('/searchDouYinShopInfo', [ShopController::class, 'searchDouYinShopInfo']);
            Route::get('/searchXhsShopList', [ShopController::class, 'searchXhsShopList']);
            Route::post('/bindXhsShop', [ShopController::class, 'bindXhsShop']);
            Route::post('/unbindXhsShop', [ShopController::class, 'unbindXhsShop']);

            // 摄像头管理
            Route::post('/camera/excel/check', [CameraController::class, 'check']);
            Route::post('/camera/excel/import', [CameraController::class, 'import']);
            Route::post('/camera/update', [CameraController::class, 'update']);
            Route::post('/camera/syncYlk', [ShopController::class, 'syncYlkCamera']);


            // 门店属性
            Route::prefix('attribute')->group(function () {
                Route::get('/list', [ShopAttributeController::class, 'getAttributeList']);//属性值列表
                Route::get('/{id}', [ShopAttributeController::class, 'getAttributeInfo'])->where('id', '\d+');//属性值详情
                Route::put('/{id}', [ShopAttributeController::class, 'updateAttribute'])->where('id', '\d+');//属性值编辑
            });

            //门店备案 员工备案
            Route::prefix('shopRecord')->group(function () {
                Route::get('/list', [\App\Kuafu\Shop\Controller\B\ShopRecordController::class, 'list']);//门店列表

            });

            Route::prefix('shopStaffRecordLog')->group(function () {
                Route::get('/list', [\App\Kuafu\Shop\Controller\B\ShopStaffRecordLogController::class, 'getLogList']);//门店列表

            });

            // 员工备案
            Route::prefix('shopStaffRecord')->group(function () {
                Route::get('list', [ShopStaffRecordController::class, 'list']); // 员工备案列表
                Route::get('info', [ShopStaffRecordController::class, 'info']); // 备案信息
                Route::post('editHealthCardDate', [ShopStaffRecordController::class, 'editHealthCardDate']);//编辑健康证日期
                Route::post('submit', [ShopStaffRecordController::class, 'submit']);//提交


            });

            // 统管门店
            Route::prefix('unifiedManagement')->group(function () {
                Route::get('waimaiIndex', [UnifiedManagementController::class, 'waimaiIndex']);
                Route::get('waimaiBlack', [UnifiedManagementController::class, 'waimaiBlack']);
                Route::post('waimaiImport', [UnifiedManagementController::class, 'waimaiImport']);
                Route::post('waimaiRefresh', [UnifiedManagementController::class, 'waimaiRefresh']);
                Route::get('douyinIndex', [UnifiedManagementController::class, 'douyinIndex']);
                Route::post('douyinImport', [UnifiedManagementController::class, 'douyinImport']);
                Route::get('douyinHistory', [UnifiedManagementController::class, 'douyinHistory']);
            });
        });

        // 系统参数配置
        Route::prefix('config')->group(function () {
            Route::get('/list', [ConfigController::class, 'getConfigList']);
            Route::get('/info/{configId}', [ConfigController::class, 'getConfigById']);
            Route::post('/', [ConfigController::class, 'addConfig']);
            Route::put('/', [ConfigController::class, 'setConfig']);
            Route::delete('/{configId}', [ConfigController::class, 'delConfig']);
            Route::get('/listByTypeAndKey', [ConfigController::class, 'listByTypeAndKey']);

            // 后台真实在用的接口
            Route::get('allModules', [ConfigController::class, 'allModules']);
            Route::get('index', [ConfigController::class, 'index']);
            Route::post('save', [ConfigController::class, 'save']);
        });

        // 系统配置
        Route::prefix('sys')->group(function () {
            // 系统菜单管理
            Route::prefix("menus")->group(function () {
                Route::get('/list', [MenusController::class, 'getMenuList']);
                Route::get('/info', [MenusController::class, 'getMenuInfo']);
                Route::post('/', [MenusController::class, 'addMenu']);
                Route::put('/', [MenusController::class, 'setMenu']);
                Route::delete('/', [MenusController::class, 'deleteMenu']);
            });
        });

        // 菜单
        Route::prefix('productMenu')->group(function () {
            Route::get("/", [ProductMenuController::class, "getMenu"]);
            Route::post("/", [ProductMenuController::class, "addMenu"]);
            Route::put("/top/{id}", [ProductMenuController::class, "top"]);
            Route::put("/setMenu/{id}", [ProductMenuController::class, "setMenu"]);
            Route::patch("/{productMenuId}", [ProductMenuController::class, "setMenuStatus"]);
            Route::delete("/{productMenuId}", [ProductMenuController::class, "delMenu"]);
            Route::get('/productLists/{id}', [ProductMenuController::class, 'productLists']);
            // 批量下发菜单
            Route::post('/batchSend', [ProductMenuController::class, 'batchMenus']);
            Route::get('/menuExport/{id}', [ProductMenuController::class, 'menuExport']);// 单个菜单导出
        });

        // 菜品
        Route::prefix('product')->group(function () {
            Route::post('/', [ProductController::class, 'insert']);

            Route::get('/', [ProductController::class, 'getProductList']);
            Route::patch('/isHot/{productId}', [ProductController::class, 'setProductIsHot']);
            Route::patch('/isRecommend/{productId}', [ProductController::class, 'setProductIsRecommend']);
//             Route::delete('/{productId}', [ProductController::class, 'deletedProduct']);
            Route::delete('/{productId}', [ProductController::class, 'delete']);
            Route::get('/{productId}', [ProductController::class, 'detail']);//菜品详情
            Route::put('/{productId}', [ProductController::class, 'update']);//编辑菜品
//             Route::patch('/{productId}', [ProductController::class, 'setProductStatus']);
            Route::patch('/{productId}', [ProductController::class, 'status']);
            // 查询菜品不同门店价格数据
            Route::get('/priceData/{productId}', [ProductController::class, 'priceData']);

        });

        // 分类
        Route::prefix('category')->group(function () {
            Route::post('/', [CategoryController::class, 'addCategory']);
            Route::get('/', [CategoryController::class, 'getCategoryList']);
            Route::get('/{categoryId}', [CategoryController::class, 'getCategoryInfo']);
            Route::put('/{categoryId}', [CategoryController::class, 'setCategory']);
            Route::delete('/{categoryId}', [CategoryController::class, 'deleteCategory']);
        });

        // 面板
        Route::prefix('dashboard')->group(function () {
            // 获取面板的的菜单列表
            Route::get('', [DashboardController::class, 'index']);

            // 获取首页的店铺以及菜单列表
            Route::get('shop', [DashboardController::class, 'shopList'])->withoutMiddleware('common.headerAuth');
        });

        // 文件上传
        Route::prefix('upload')->group(function () {
            Route::post('images', [UploadController::class, 'ImagesUpload']);
        });

        // 横幅位置
        Route::prefix('banner/config')->group(function () {
            Route::get("/{bannerConfigId}", [BannerConfigController::class, "getBannerConfigById"]);
            Route::get("/", [BannerConfigController::class, "getBannerConfigList"]);
            Route::post("/", [BannerConfigController::class, "addBannerConfig"]);
            Route::put("/{bannerConfigId}", [BannerConfigController::class, "setBannerConfig"]);
            Route::delete("/{bannerConfigId}", [BannerConfigController::class, "delBannerConfig"]);
        });

        // 横幅列表
        Route::prefix('banner')->group(function () {
            Route::post("/", [BannerController::class, "addBanner"]);
            Route::get("/", [BannerController::class, "getBanner"]);
            Route::delete("/{bannerId}", [BannerController::class, "delBanner"]);
            Route::put("/{bannerId}", [BannerController::class, "setBanner"]);
            Route::get("/{bannerId}", [BannerController::class, "getBannerById"]);
        });

        // 订单
        Route::prefix('order')->group(function () {
            Route::get("/", [OrderController::class, "index"]); // 店内订单列表
            Route::get("/shortList", [OrderController::class, "shortList"]); // 店内订单简易列表
            Route::get("/payChannels", [OrderController::class, "payChannels"]); // 结账方式列表
            Route::get("/{id}", [OrderController::class, "show"])->where('id', '\d+'); // 订单详情
            Route::get('/productSale', [OrderController::class, 'bProductSellStatistics']);//菜品销售统计
            Route::get('/productSale/excel', [OrderController::class, 'bProductSellStatisticsExcel']);//菜品销售统计导出
        });

        // 活动管理
        Route::prefix('activities')->group(function () {
            Route::get("/getActivitiesList", [ActivityController::class, "getActivityList"]);
            Route::get("/{id}", [ActivityController::class, "getActivityById"])->where('id', '\d+');
            Route::post("/", [ActivityController::class, "create"]);
            Route::put("/{id}", [ActivityController::class, "update"]);
            Route::post("/setStatus", [ActivityController::class, "setStatus"]);
            Route::delete("/{id}", [ActivityController::class, "delActivity"]);
            Route::post('/materialsGeneration/{id}', [ActivityController::class, 'materialsGeneration']);
        });

        // 优惠券
        Route::prefix('coupons')->group(function () {
            Route::get("/getCouponById/{id}", [CouponController::class, "getCouponById"]);
            Route::get("/getCouponList", [CouponController::class, "getCouponList"]);
            Route::post("/", [CouponController::class, "addCoupon"]);
            Route::put("/{id}", [CouponController::class, "update"]);
            Route::patch("/{id}", [CouponController::class, "patchCouponStatus"]);
            Route::delete("/{id}", [CouponController::class, "delCoupon"]);
        });

        // 用户优惠券
        Route::prefix('customerCoupon')->group(function () {
            Route::get("/getCustomerCouponById/{id}", [CustomerCouponController::class, "getCustomerCouponById"]);
            Route::get("/getCustomerCouponListById/{id}",
                [CustomerCouponController::class, "getCustomerCouponListById"]);
            Route::post("/", [CustomerCouponController::class, "addCustomerCoupon"]);
            Route::put("/{id}", [CustomerCouponController::class, "setCustomerCoupon"]);
            Route::patch("/{id}", [CustomerCouponController::class, "patchCustomerCouponStatus"]);
            Route::delete("/{id}", [CustomerCouponController::class, "delCustomerCoupon"]);
            Route::get("/lists", [CustomerCouponController::class, "lists"]);
        });

        // 统计
        Route::prefix('statistics')->group(function () {
            Route::get("/paymentIndex", [StatisticsController::class, "paymentIndex"]);
            Route::get("/paymentExcel", [StatisticsController::class, "paymentExcel"]);
            Route::get('/comprehensiveList', [StatisticsController::class, "comprehensiveList"]);
            Route::get('/comprehensiveExcel', [StatisticsController::class, "comprehensiveExcel"]);
            Route::get('/shopOrderExcel', [StatisticsController::class, "shopOrderExcel"]);
        });

        // 优惠券包
        Route::prefix('couponPackage')->group(function () {
            Route::post("/", [CouponPackageController::class, "create"]);
            Route::put("/{id}", [CouponPackageController::class, "update"]);
            Route::get("/lists", [CouponPackageController::class, "lists"]);
            Route::get("/row/{id}", [CouponPackageController::class, "row"]);
            Route::post("/setStatus", [CouponPackageController::class, "setStatus"]);
            //券包销售详情
            Route::get('/salesDetail', [CouponPackageController::class, "getCouponPackageSalesDetail"]);
            //券包销售明细导出
            Route::get('/salesDetailExport', [CouponPackageController::class, "exportDetail"]);
        });

        // 省市区列表
        Route::prefix('area')->group(function () {
            Route::get("/lists", [AreaController::class, "areaLists"]);
        });

        // 自定义支付
        Route::prefix('customPayment')->group(function () {
            Route::post("/", [CustomPaymentController::class, "add"]); //新增
            Route::post("/setStatus", [CustomPaymentController::class, "setStatus"]);//停用 | 启用
            Route::get("/lists", [CustomPaymentController::class, "getPaymentList"]);//获取列表
            Route::post("/send", [CustomPaymentController::class, "sendPayment"]);//下发
            Route::post("/setStatusShopPayment",
                [CustomPaymentController::class, "setStatusShopPayment"]);//停用 | 启用 门店支付方式
            Route::get("/shopPaymentList", [CustomPaymentController::class, "shopPaymentList"]);//门店结帐方式
            Route::get("/sendPaymentHistory", [CustomPaymentController::class, "sendPaymentHistory"]);//下发记录
            Route::get("/getPaymentShop", [CustomPaymentController::class, "getPaymentShop"]);//支付方式已下发门店列表
        });

        // banner配置
        Route::prefix('bannerCommon')->group(function () {
            Route::post("/", [BannerCommonController::class, "insert"]);
            Route::put("/{id}", [BannerCommonController::class, "edit"]);
            Route::post("/status", [BannerCommonController::class, "status"]);//停用 | 启用
            Route::delete("/{id}", [BannerCommonController::class, "del"]);
            Route::get("/index", [BannerCommonController::class, "index"]);
            Route::get("/config", [BannerCommonController::class, "bannerConfig"]);
            Route::get("/search", [BannerCommonController::class, "bannerSearch"]);
            Route::get("/getCount/{id}", [BannerCommonController::class, "getCount"]);
        });

        // 小程序-投诉工单
        Route::prefix('complain')->group(function () {
            Route::get("/", [ComplainController::class, "list"]);
            Route::get('/issueList', [ComplainController::class, 'issueList']);
            Route::get("/{id}", [ComplainController::class, "info"]);
            Route::put("/{id}", [ComplainController::class, "update"]);
        });

        // 导出报表-下载清单记录
        Route::prefix('exportDownloads')->group(function () {
            Route::get("/", [ExportDownloadsController::class, "lists"]);
            Route::delete("/{id}", [ExportDownloadsController::class, "delete"]);
        });

        // 网商
        Route::prefix("mybank")->group(function () {
            Route::get("/", [MybankEntryController::class, "index"]);
            Route::post("/", [MybankEntryController::class, "create"])->middleware('customerThrottle:1,5');
            Route::get("remindActivate/{id}", [MybankEntryController::class, "remindActivate"])->where('id', '\d+');
            Route::get("remindWithholding/{id}", [MybankEntryController::class, "remindWithholding"])
                ->where('id', '\d+');
            Route::post("confirmArrangement/{id}", [MybankEntryController::class, "confirmArrangement"])
                ->where('id', '\d+');
            Route::get("/{id}", [MybankEntryController::class, "detail"])->where('id', '\d+');
            Route::patch("/{id}", [MybankEntryController::class, "update"])->where('id', '\d+');
            Route::get("totalBillList", [MybankController::class, "totalBillList"]);//总账户入账记录
            Route::get("expenseRecordList", [MybankController::class, "expenseRecordList"]);//后台商户收支明细
            Route::get('financeList', [MybankController::class, 'financeList']);//后台财务清分列表
            Route::get("financeDetail", [MybankController::class, "financeDetail"]);//后台财务清分明细
            Route::get("batchQuery", [MybankController::class, "batchQuery"]);//批次查询接口
        });

        // 外卖订单
        Route::prefix('waiMaiOrder')->group(function () {
            Route::get("/", [WaiMaiOrderController::class, "index"]); //外卖订单列表
            Route::get('/detail/{id}', [WaiMaiOrderController::class, "detail"])->where('id', '\d+');//外卖订单详情
        });

        // 云巡店
        Route::prefix('tour')->group(function () {
            Route::get("/device/cameraList", [CameraController::class, "cruiseCameraList"]); // 摄像头设备列表
            Route::get("/device/cameraInfo", [CameraController::class, "cruiseCameraInfo"]); // 摄像头详情
            Route::get("/device/cameraRecordDate", [CameraController::class, "cruiseCameraRecordDate"]); // 摄像头历史时段
            Route::get("/device/cameraRecordPlay", [CameraController::class, "cruiseCameraRecordPlay"]); // 摄像头历史时段播放
            Route::get("/device/cameraHeartBeat", [CameraController::class, "cruiseCameraHeartBeat"]); // 心跳接口
            Route::get('/device/cameraSearch', [CameraController::class, 'cameraSearch']); // 摄像头设备列表-门店搜索项
            Route::get('/device/cameraLists', [CameraController::class, 'cruiseCameraLists']); // 摄像头设备列表-门店搜索
        });

        // 工具
        Route::prefix('tools')->group(function () {
            // 物料素材模版
            Route::prefix('sourceMaterialTemplate')->group(function () {
                Route::get('list', [ToolsController::class, "list"]);
                Route::get('typeConfig', [ToolsController::class, "typeConfig"]);
                Route::get('info/{id}', [ToolsController::class, "info"])->where('id', '\d+');
                Route::post('save', [ToolsController::class, "save"]);
                Route::delete('delete/{id}', [ToolsController::class, "delete"])->where('id', '\d+');
            });
        });
    });


if (env('TESTCONTROLLER')) {
    Route::any('test', [\App\Http\Controllers\TestController::class, 'test']);
    Route::get('test/{id}', [\App\Http\Controllers\TestController::class, 'test']);
}

// 内网白名单
Route::prefix('ip-white')->group(function () {
    Route::get('forceLoginOut', [IpWhiteController::class, 'forceLoginOut']);
    Route::get('userLists', [IpWhiteController::class, 'userLists']);
    Route::get('totalLists', [IpWhiteController::class, 'totalLists']);
});

// 内部手动处理
Route::prefix('inner-manual')->middleware(KfNetMiddleware::class)->group(function () {

    // 刷新组织架构fs_users
    Route::get('refreshFsUsers', [\App\Kuafu\Feishu\Controller\UserController::class, 'refreshFsUsers']);
});

